package com.game.commons.configuration.transformers;

import java.lang.reflect.Field;

import com.game.commons.configuration.PropertyTransformer;
import com.game.commons.configuration.TransformationException;


/**
 * 字符串转换成double类型
 * @author 杜祥
 * @create 2013-6-29
 */
public class DoubleTransformer implements PropertyTransformer<Double>
{
	public static final DoubleTransformer	SHARED_INSTANCE	= new DoubleTransformer();

	@Override
	public Double transform(String value, Field field) throws TransformationException
	{
		try
		{
			return Double.parseDouble(value);
		}
		catch(Exception e)
		{
			throw new TransformationException(e);
		}
	}
}
